<?php $this->load->view('inc/header1.php');?>
<div style="position: relative;overflow: hidden;width: 700px;margin: 0px auto;">

<div class="b3"></div>
<style>
.pagenav{
	padding: 10px 0px;
	border: none;
	width: auto;
}
</style>
<div id="page-board" class="page-container">
	<div class="page-left">
		<div class="page-left-cont">
    		<h1>听你留言板</h1>
    			有任何问题请在下方留言,,,
			<div class="b3"></div>
			
			<form id="frm-board" action="<?php echo site_url('c=page&m=board_do');?>"
				submitbefor="board_befor"
			>
				<input id="cont" class="inp1" name="cont" maxlength="200"/>
				<a class="btn btn-7 btn-ajax-submit" frmid="frm-board" href="javascript:void(0);">发表</a>
			</form>
			<div class="b3"></div>
			<div class="board-list">
			<?php foreach ($list_board as $k=>$v):?>
			<div class="board-item">
				<div class="avatar">
					<?php avatar($v->posteremail);?>
				</div>
				<div class="c2 fs2 postinfo">
					<span class="nname"><?php echo $v->postername;?></span>
					<span class="c4"><?php echo date('Y-m-d H:i:s',$v->atime);?></span>
				</div>
            	<div class="opt">
            		<a class="btn-reply fs2" href="javascript:void(0);">回复</a>
            		<?php if($is_login && $loginer->id == $v->poster_id):?>
            		<a class="btn-ajax-confirm fs2" msg="Sure 不   ？"
            			href="<?php echo site_url('c=page&m=board_del&id='.$v->id);?>">删除</a>
            		<?php endif;?>
            	</div>
				<div class="cont">
					<?php echo $v->cont;?>
				</div>
				<div style="clear: both;"></div>
			</div>
			<?php endforeach;?>
			</div>
			
			<?php echo $pagenav;?>
			
		</div>
		
	</div>
	
	<div class="page-right">
		<?php $this->load->view('page/inc_slide_menu.php');?>	
	</div>
	<div style="clear: both;"></div>

</div>
</div>
<script type="text/javascript">
$(function(){
	$('#cont').val('');

	$(function(){
		$('.btn-reply').click(function(){
			var postername = $(this).parents('.board-item').find('.nname').html();
			$('#cont').val('#'+postername.trim()+'# ');
		});
	});
	
});

function board_befor($frm){
	var cont = $('#cont').val().trim();
	if(cont.length <= 0){
		asyncbox.tips('内容不能为空！','error');
		return false;
	}
	return true;
}

ajaxinit();
</script>

<?php $this->load->view('inc/footer1.php');?>
